From c17ffaf89f5ec9e5f0edf7d12130c2a265c98bcb Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 10 Dec 2010 18:29:50 +0000 Subject: [PATCH] libxl: return an error if connection to xenstore fails Signed-off-by: Ian Campbell Acked-by: Ian Jackson Signed-off-by: Ian Jackson --- tools/libxl/libxl_device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index ad7f8bc113..7d1796b2e7 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -429,6 +429,11 @@ int libxl__wait_for_device_model(libxl_ctx *ctx, char **l = NULL; xsh = xs_daemon_open(); + if (xsh == NULL) { + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to open xenstore connection"); + goto err; + } + path = libxl__sprintf(&gc, "/local/domain/0/device-model/%d/state", domid); xs_watch(xsh, path, path); tv.tv_sec = LIBXL_DEVICE_MODEL_START_TIMEOUT; @@ -469,6 +474,7 @@ again: xs_unwatch(xsh, path, path); xs_daemon_close(xsh); LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model not ready"); +err: libxl__free_all(&gc); return -1; } -- 2.30.2